﻿package com.wandian.model.vo
{ 
	import com.wandian.data.GameData;
	
	import flash.utils.ByteArray;
	
	import flashx.textLayout.formats.Float;

    dynamic public class PlayerVo extends Object
    {
        public var openId:int;
        public var userid:uint;
//        public var userId:uint;//id
        public var userName:String;//游戏账号
        public var name:String;//游戏昵称
        public var headImage:ByteArray;
        public var icon:String;
        public var personId:int;
        public var vip:uint;
        public var level:uint;
        public var sex:int;
        public var initSex:int;
//        public var gold:uint;
        public var money:Number;
        /**
         * 显示在当前携带的金额，
         * @default 
         */
        public var stake:Number;
        public var sumGame:uint;
        public var winGame:uint;
        public var honor:uint;
        public var star:uint;
        public var rank:uint;
        public var winRank:uint;
        public var seatId:int;
        private var _state:int = 0;
        private var _lastAction:int = 0;
        /**
         * 下注金额
         * @default 
         */
        public var callChip:Number = 0;
        public var giveChip:Number = 0;
        public var bankAssets:uint;
        public var giftPcate:uint;
        public var giftPframe:uint;
        public var banSpeak:int = -1;
        public var yellowvip:int;
        public var isyearvip:int;
        public var isSend:Boolean = false;

        public function PlayerVo()
        {
            return;
        }

        public function get lastAction() : int
        {
            return this._lastAction;
        }

        public function set lastAction(param1:int) : void
        {
            this._lastAction = param1;
            return;
        }

        public function get state() : int
        {
            return this._state;
        }

        public function set state(param1:int) : void
        {
            this._state = param1;
            return;
        }

        public function set stateSocket(param1:int) : void
        {
            if ((param1 & 1 << 3) != 0)
            {
                if ((param1 & 1 << 4) != 0)
                {
                    this.state = GameData.PLAYING_CLOSE_SOCKE;
                }
                else
                {
                    this.state = GameData.NO_PLAYING_CLOSE_SOCKE;
                }
            }
            else if ((param1 & 1 << 1) != 0)
            {
                this.state = GameData.WAIT_NEXT_GAME;
            }
            else if ((param1 & 1 << 2) != 0)
            {
                this.state = GameData.WAIT_BUY_IN;
            }
            else if ((param1 & 1 << 4) != 0)
            {
                this.state = GameData.PLAYING_GAME;
            }
            else
            {
                this.state = 0;
            }
            return;
        }

		public function toString():String{
			return "userid "+this.userid+","+"name "+this.name+","+"seatId "+this.seatId+","+"money "+this.money+","+"userid "+this.stake;
		}
        public function init() : void
        {
            this.openId = 0;
            this.userid = 0;
            this.name = "";
            this.icon = "";
            this.stake = 0;
            this.bankAssets = 0;
            this.experience = 0;
//            this.gold = 0;
            this.hasNewMessage = 0;
            this.honor = 0;
            this.level = 0;
            this.money = 0;
            this.seatId = 0;
            this.star = 0;
            this.vip = 0;
            this.lastAction = 0;
            this._state = GameData.LOOK_ON;
            this.rank = 0;
            this.winRank = 0;
            this.giveChip = 0;
            this.giftPcate = 0;
            this.giftPframe = 0;
            this.yellowvip = 0;
            this.isyearvip = 0;
            this.isSend = false;
            this.banSpeak = -1;
            return;
        }

    }
}
